package com.ruoyi.course.service.impl;

import java.util.List;

import com.ruoyi.common.constant.SysConstants;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.course.mapper.SysStudentPaperMapper;
import com.ruoyi.course.domain.SysStudentPaper;
import com.ruoyi.course.service.ISysStudentPaperService;

/**
 * 学员试卷Service业务层处理
 * 
 * @author YJF
 */
@Service
public class SysStudentPaperServiceImpl implements ISysStudentPaperService 
{
    @Autowired
    private SysStudentPaperMapper sysStudentPaperMapper;

    /**
     * 查询学员试卷
     * 
     * @param studentPaperId 学员试卷主键
     * @return 学员试卷
     */
    @Override
    public SysStudentPaper selectSysStudentPaperByStudentPaperId(Long studentPaperId)
    {
        return sysStudentPaperMapper.selectSysStudentPaperByStudentPaperId(studentPaperId);
    }

    /**
     * 查询学员试卷列表
     * 
     * @param sysStudentPaper 学员试卷
     * @return 学员试卷
     */
    @Override
    public List<SysStudentPaper> selectSysStudentPaperList(SysStudentPaper sysStudentPaper)
    {
        sysStudentPaper.setDelFlag(SysConstants.CONSTANT_STR0);
        return sysStudentPaperMapper.selectSysStudentPaperList(sysStudentPaper);
    }

    /**
     * 新增学员试卷
     * 
     * @param sysStudentPaper 学员试卷
     * @return 结果
     */
    @Override
    public int insertSysStudentPaper(SysStudentPaper sysStudentPaper)
    {
        sysStudentPaper.setCreateTime(DateUtils.getNowDate());
        return sysStudentPaperMapper.insertSysStudentPaper(sysStudentPaper);
    }

    /**
     * 修改学员试卷
     * 
     * @param sysStudentPaper 学员试卷
     * @return 结果
     */
    @Override
    public int updateSysStudentPaper(SysStudentPaper sysStudentPaper)
    {
        sysStudentPaper.setUpdateTime(DateUtils.getNowDate());
        return sysStudentPaperMapper.updateSysStudentPaper(sysStudentPaper);
    }

    /**
     * 批量删除学员试卷
     * 
     * @param studentPaperIds 需要删除的学员试卷主键
     * @return 结果
     */
    @Override
    public int deleteSysStudentPaperByStudentPaperIds(Long[] studentPaperIds)
    {
        return sysStudentPaperMapper.deleteSysStudentPaperByStudentPaperIds(studentPaperIds);
    }

    /**
     * 删除学员试卷信息
     * 
     * @param studentPaperId 学员试卷主键
     * @return 结果
     */
    @Override
    public int deleteSysStudentPaperByStudentPaperId(Long studentPaperId)
    {
        return sysStudentPaperMapper.deleteSysStudentPaperByStudentPaperId(studentPaperId);
    }
}
